#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/ProjData.h"

using namespace fxcc::yml;
using CType = fxcc::graph::common::ProjData;;

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{
	SetVariable<bool>(node, "m_IsOrtho", inst.m_IsOrtho);
	SetVariable<float>(node, "m_HorizontalFOV", inst.m_HorizontalFOV);
	SetVariable<float>(node, "m_ClipPlaneNear", inst.m_ClipPlaneNear);
	SetVariable<float>(node, "m_ClipPlaneFar", inst.m_ClipPlaneFar);
	SetVariable<float>(node, "m_Aspect", inst.m_Aspect);
	SetVariable<float>(node, "m_OrthographicWidth", inst.m_OrthographicWidth);
	SetVariable<float>(node, "m_OrthographicHeight", inst.m_OrthographicHeight);

}


template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{
	GetVariable<bool>(node, "m_IsOrtho", inst.m_IsOrtho);
	GetVariable<float>(node, "m_HorizontalFOV", inst.m_HorizontalFOV);
	GetVariable<float>(node, "m_ClipPlaneNear", inst.m_ClipPlaneNear);
	GetVariable<float>(node, "m_ClipPlaneFar", inst.m_ClipPlaneFar);
	GetVariable<float>(node, "m_Aspect", inst.m_Aspect);
	GetVariable<float>(node, "m_OrthographicWidth", inst.m_OrthographicWidth);
	GetVariable<float>(node, "m_OrthographicHeight", inst.m_OrthographicHeight);

	return true;
}
